<template>
	<view class="withdrawal">
		<Navbar>提现</Navbar>
		<scroll-view scroll-y class="scroll_view">
			<view class="header">
				<view class="header_view">
					<view class="key">拥有官银</view>
					<view class="value">{{silver}}</view>
				</view>
				<image :src="`${baseImageUrl}/common/gy.png`"></image>
			</view>
			<view class="title">提现金额</view>
			<view class="list">
				<view class="item" :class="active==index?'active':''" v-for="(item,index) in list"
					@click="active=index">
					<view class="price">￥{{item.money}}</view>
					<view class="number">{{item.value}}个元宝</view>
				</view>
			</view>
			<view class="title">提现方式</view>
			<view class="cell_view">
				<view class="item" v-for="(item,index) in 1" @click="type=index">
					<view class="item_view">
						<view class="item_head">
							<image src="@/static/images/add/1202_5.png"></image>
							<view class="name">提现至微信</view>
						</view>
						<!-- <view class="phone">已绑定 136****4548</view> -->
					</view>
					<view class="icon">
						<image src="@/static/images/add/1202_3.png" v-if="type==index"></image>
						<image src="@/static/images/add/1202_4.png" v-else></image>
					</view>
				</view>
			</view>
			<view class="submit">
				<view @click="submit">提现</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	import {
		userInfo
	} from '@/request/api.js';
	export default {
		data() {
			return {
				silver: 0,
				active: 0,
				list: [],
				type: 0
			}
		},
		onLoad() {
			this.getUserInfo();
		},
		methods: {
			async getUserInfo() {
				let {
					user
				} = await userInfo();
				this.silver = user.silver;
			},
			async submit() {
				this.$u.toast("敬请期待");
			}
		}
	}
</script>

<style scoped lang="scss">
	.withdrawal {
		height: 100vh;
		background: #29170D;

		.scroll_view {
			height: calc(100vh - #{$navbarHeight});
			padding: 30rpx 30rpx 0;
			box-sizing: border-box;

			.header {
				width: 100%;
				height: 238rpx;
				padding: 48rpx 40rpx;
				box-sizing: border-box;
				background: url(@/static/images/add/1202_2.png) no-repeat;
				background-size: 100% 100%;
				display: flex;
				justify-content: space-between;
				align-items: center;

				.header_view {
					flex: 1;
					padding-top: 10rpx;
					box-sizing: border-box;

					.key {
						line-height: 1;
						color: #494338;
						font-size: 42rpx;
						font-weight: 400;
						font-family: LiSu;
						margin-bottom: 18rpx;
					}

					.value {
						line-height: 1;
						color: #494338;
						font-size: 50rpx;
						font-weight: 400;
						font-family: SimSun;
					}
				}

				image {
					width: 142rpx;
					height: 142rpx;
				}
			}

			.title {
				height: 110rpx;
				line-height: 110rpx;
				color: #FFFFFF;
				font-size: 42rpx;
				font-weight: 400;
				font-family: LiSu;
			}

			.list {
				display: flex;
				flex-wrap: wrap;

				.item {
					width: 220rpx;
					height: 220rpx;
					margin-bottom: 20rpx;
					margin-right: 15rpx;
					background: url(@/static/images/add/1202_9.png) no-repeat;
					background-size: 100% 100%;
					display: flex;
					flex-direction: column;
					justify-content: center;
					align-items: center;

					&.active {
						background: url(@/static/images/add/1202_8.png) no-repeat;
						background-size: 100% 100%;
					}

					&:nth-child(3n) {
						margin-right: 0;
					}

					.price {
						color: #494338;
						font-size: 50rpx;
						font-weight: 400;
						font-family: LiSu;
						margin-bottom: 20rpx;
					}

					.number {
						color: #494338;
						font-size: 24rpx;
						font-weight: 400;
						font-family: SimSun;
					}
				}
			}

			.cell_view {
				.item {
					width: 100%;
					height: 140rpx;
					margin-bottom: 10rpx;
					padding: 0 30rpx;
					box-sizing: border-box;
					background: url(@/static/images/add/1202_6.png) no-repeat;
					background-size: 100% 100%;
					display: flex;
					justify-content: space-between;
					align-items: center;

					.item_view {
						flex: 1;

						.item_head {
							display: flex;
							align-items: center;

							image {
								width: 50rpx;
								height: 50rpx;
							}

							.name {
								color: #494338;
								font-size: 36rpx;
								font-weight: 400;
								font-family: LiSu;
							}
						}

						.phone {
							color: #494338;
							font-size: 28rpx;
							font-weight: 400;
							font-family: SimSun;
						}
					}

					.icon {
						width: 44rpx;
						height: 44rpx;

						image {
							width: 100%;
							height: 100%;
						}
					}
				}
			}

			.submit {
				margin-top: 44rpx;
				display: flex;
				justify-content: center;

				view {
					width: 370rpx;
					height: 140rpx;
					line-height: 140rpx;
					text-align: center;
					color: #FFFFFF;
					font-size: 36rpx;
					font-weight: 400;
					font-family: SimSun;
					// background: url(@/static/images/add/1202_7.png) no-repeat;
					background: url(#{$baseImageUrl}/common/btn2.png) no-repeat;
					background-size: 100% 100%;
				}
			}
		}
	}
</style>